package com.allscore.demo.kafka.cosumer;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

import java.io.IOException;


@Component
public class ConsumerData {

    private static final Logger LOG = LoggerFactory.getLogger(ConsumerData.class);


    @KafkaListener(topics = {"test0002"}, containerFactory = "kafkaListenerContainerFactory")
    public void listen(ConsumerRecord<?, ?> record) throws IOException {
        String value = (String) record.value();
        LOG.info(value);

    }


}
